package com.handsome.service.impl;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.handsome.dao.HsUserDefinedSqlMapper;
import com.handsome.service.TestService;
import com.handsome.widgets.CheckboxWidget;
import com.handsome.widgets.OptionWidget;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


@Service
public class TestServiceImpl implements TestService {


    @Autowired
    HsUserDefinedSqlMapper logMapper;


    @Override
    public String getLogs() {
        return null;
    }

    @Override
    public List<CheckboxWidget> checkboxData() {
        System.out.println("checkboxData run");
        CheckboxWidget checkbox = new CheckboxWidget();

        checkbox.setLabel("checkbox");
        checkbox.setChecked(true);
        checkbox.setValue("aa");
        checkbox.setDisabled(true);
        ArrayList<CheckboxWidget> objects = new ArrayList<>();
        objects.add(checkbox);
        return objects;
    }

    @Override
    public List<OptionWidget> optionData() {
        System.out.println("optionData run111");
        OptionWidget optionWidget = new OptionWidget();
        optionWidget.setLabel("aa");
        optionWidget.setValue(1);
        optionWidget.setSelected(false);
        ArrayList<OptionWidget> objects = new ArrayList<>();
        objects.add(optionWidget);
        return objects;

    }
}
